package chapter10.exercise.test11;

public class People {

    public Fly can() {
        Fly fly = null;
        if (true) {
            class SuperPeople implements Fly {
                public void fly() {
                    System.out.println("超人:正在飞");
                }
            }
            fly = new SuperPeople();
        }

        return fly;
    }

    private class SuperPeople implements Fly {
        public void fly() {
            System.out.println("蝙蝠侠:正在飞");
        }
    }

    public Fly can1() {
        return new SuperPeople();
    }

}
